import request from '@/router/axios';

/**
 * 资源列表数据
 *
 */
export const getList = (current, size, params) => {
  return request({
    url: '/application/resource/page',
    method: 'POST',
    params: {
      ...params,
      current,
      size,
    }
  })
}

/**
 * 添加资源
 * @param row
 */
export const add = (row) => {
  return request({
    url: '/application/resource/add',
    method: 'post',
    data: row
  })
}

/**
 * 父级资源
 * @param id
 */
export const parent = (id) => {
  return request({
    url: '/application/resource/parent',
    method: 'get'
  })
}

/**
 * 更新资源
 * @param row
 */
export const update = (row) => {
  return request({
    url: '/application/resource/update',
    method: 'post',
    data: row
  })
}

/**
 * 删除资源
 * @param row
 */
export const remove = (row) => {
  return request({
    url: '/application/resource/remove',
    method: 'post',
    data: row
  })
}